<div class="container my-6 my-md-9">
  {%- liquid 
    assign mark = 'h3'
    if section.settings.enable_adjust_h_tag
      assign mark = section.settings.adjust_h_tag_to
    endif
  %}
  <{{ mark }} class="h2 {{ section.settings.section_container }}">{{ section.settings.product_title }}</{{ mark }}>
  <div class="row mt-md-n4 mt-n3 pt-3 pt-md-6">
      <div class="col-12 col-md-{{ section.settings.columns_per_row }} pt-3 pt-md-4">
        {% for block in section.blocks %}
        {% assign odd = forloop.length | modulo:2 %}
        {% if odd == 1 %}
          {% assign length = forloop.length | plus: 1 %}
        {% else %}
          {% assign length = forloop.length %}
        {% endif %}
        {% assign number = length | divided_by: 2 %}
        {% if forloop.index <= number %}
          <div class="{% if forloop.first == false %}pt-3 pt-md-4 {% endif %} {% if section.settings.columns_per_row == '12' %}row{% endif %} border-bottom {% if section.settings.columns_per_row == '6' %}mw-text-4{% endif %}">
            <h4 class="{% if section.settings.columns_per_row == '12' %}mw-text-2 pe-xl-8 pe-md-6{% endif %}">{{ block.settings.specs_title }}</h4>
            {% if block.settings.specs_richtext != blank %}
            <div class="{% if section.settings.columns_per_row == '12' %}col-12 col-md{% endif %} pb-3 pb-md-4 richtext-with-link">{{ block.settings.specs_richtext | replace: "<p>", "<p class='mb-1'>" }}</div>
            {% endif %}
          </div>
        {% endif %}
        
    {% endfor %}
      </div>
      <div class="col-12 col-md-{{ section.settings.columns_per_row }} pt-3 pt-md-4">
        {% for block in section.blocks %}
          {% assign odd = forloop.length | modulo:2 %}
          {% if odd == 1 %}
            {% assign length = forloop.length | plus: 1 %}
          {% else %}
            {% assign length = forloop.length %}
          {% endif %}
          {% assign number = length | divided_by: 2 %}
          {% assign numberPlus = number | plus: 1 %}
          {% if forloop.index > number %}
            <div class="{% if forloop.index != numberPlus %}pt-3 pt-md-4{% endif %}{% if section.settings.columns_per_row == '12' %} row{% endif %} border-bottom {% if section.settings.columns_per_row == '6' %}mw-text-4{% endif %}">
              <h4 class="{% if section.settings.columns_per_row == '12' %}mw-text-2 pe-xl-8 pe-md-5{% endif %}">{{ block.settings.specs_title }}</h4>
              {% if block.settings.specs_richtext != blank %}
              <div class="{% if section.settings.columns_per_row == '12' %}col-12 col-md{% endif %} pb-3 pb-md-4">{{ block.settings.specs_richtext | replace: "<p>", "<p class='mb-1'>" }}</div>
              {% endif %}
            </div>
          {% endif %}
          
      {% endfor %}
        </div>


  </div>
</div>

{% schema %}
  {
    "name": "kik-Ar-product-details",
    "tag": "section",
    "settings": [
      {
        "type": "text",
        "id": "product_title",
        "label": "Heading ",
        "default": "Product details"
      },
       {
          "type": "text",
          "id": "section_container",
          "label": "Section class",
        },
      {
        "type": "checkbox",
        "id": "enable_adjust_h_tag",
        "label": "Enable adjust H tag",
        "default": false
      },
      {
        "type": "select",
        "id": "adjust_h_tag_to",
        "label": "Adjust the H tag to",
        "options": [
          {
            "value": "h1",
            "label": "H1"
          },
          {
            "value": "h2",
            "label": "H2"
          },
          {
            "value": "h3",
            "label": "H3"
          },
          {
            "value": "h4",
            "label": "H4"
          },
          {
            "value": "h5",
            "label": "H5"
          },
          {
            "value": "h6",
            "label": "H6"
          }
        ],
        "default":   "h3"
      },
      {
        "type": "radio",
        "id": "columns_per_row",
        "label": "Columns per row",
        "options": [
        {
        "value": "12",
        "label": "one"
        },
        {
        "value": "6",
        "label": "two"
        }
        ],
        "default": "12"
        }
    ],
    "blocks": [
    {
      "type": "specs",
      "name": "Specs",
      "settings": [
      {
        "type": "text",
        "id": "specs_title",
        "label": "Label"
      },
      {
        "type": "richtext",
        "id": "specs_richtext",
        "label": "Content"
      }
      ]
    }
    ],
    "presets": [
      {
        "name": "kik-Ar-product-details",
        "blocks": [
          {
            "type": "specs",
            "settings": {
              "specs_title": "Weight",
              "specs_richtext": "<p>10.25 ounces</p>"
            }
          },
          {
            "type": "specs",
            "settings": {
              "specs_title": "Size",
              "specs_richtext": "<p>Height: 95 inches</p><p>Width: 95 inches</p><p>Depth: 95 inch</p>"
            }
          },
          {
            "type": "specs",
            "settings": {
              "specs_title": "Color",
              "specs_richtext": "<p>Red, Blue, Gold, White</p>"
            }
          }
        ]
      }
    ]
  }
{% endschema %}